@section('content')
<div class="am-cf am-padding">
   <div class="am-fl am-cf">
      <a href="{{URL::route('order')}}"><strong class="am-text-primary am-text-lg">订单列表</strong></a> / <small>100000</small>
   </div>
</div>

<div class="am-g">
<div class="am-u-md-6 am-margin-bottom">
		<form class="am-form-inline" name="" role="form" method="post" action="{{URL::route('order.delivery')}}" data-am-validator>
		  <div class="am-form-group">
		    <input type="text" name="express_name" id="express_name" class="am-form-field" placeholder="快递公司"
		    	value="{{$order->express_name}}" required maxlength="32">
		  </div>
		
		  <div class="am-form-group">
		    <input type="text" name="express_id" id="express_id" class="am-form-field" placeholder="快递单号"
		    	value="{{$order->express_id}}" required maxlength="32">
		    <input name="status" value="2" type="hidden"/>
		    <input name="id" value="{{$order->id}}" type="hidden"/>
		  </div>
		  <button type="submit" class="am-btn am-btn-primary">发货</button>
		</form>
	</div>
	
	<div class="am-u-md-6 am-margin-bottom">
		<form class="am-form-inline" role="form" method="post" action="{{URL::route('order.returns')}}" data-am-validator>
		  <div class="am-form-group">
		    <input type="text" name="returns_express_name" id="express_name" class="am-form-field" placeholder="快递公司"
		    	value="{{$order->returns_express_name}}" required maxlength="32">
		  </div>
		
		  <div class="am-form-group">
		    <input type="text" name="returns_express_id" id="returns_express_id" class="am-form-field" placeholder="快递单号"
		    	value="{{$order->returns_express_id}}" required maxlength="32">
		    <input name="status" value="3" type="hidden"/>
		    <input name="id" value="{{$order->id}}" type="hidden"/>
		  </div>
		  <button type="submit" class="am-btn am-btn-primary">退货</button>
		</form>
	</div>
	<div class="am-u-md-6 am-margin-bottom">
		<form class="am-form-inline" role="form" method="post" action="{{URL::route('order.offline-pay')}}" data-am-validator>
		   <div class="am-form-group" style="width:74%;">
		    <textarea name="remark" id="remark" class="am-form-field" placeholder="有特殊需要，请备注订单"
		    	style="width: 100%" required maxlength="512">{{$order->remark}}</textarea>
		    <input name="id" value="{{$order->id}}" type="hidden"/>
		  </div>
		  
		  <button type="submit" class="am-btn am-btn-primary">线下支付</button>
		  <p class="am-text-danger error-msg" style="display: inline-block;"></p>
		</form>
	</div>
	
	<div class="am-u-md-6 am-margin-bottom">
		<form class="am-form-inline" role="form" method="post" action="{{URL::route('order.remark')}}" data-am-validator>
		  <div class="am-form-group" style="width:74%;">
		    <textarea name="remark" id="remark" class="am-form-field" placeholder="有特殊需要，请备注订单"
		    	style="width: 100%" required maxlength="512">{{$order->remark}}</textarea>
		    <input name="id" value="{{$order->id}}" type="hidden"/>
		  </div>
		  
		  <button type="submit" class="am-btn am-btn-primary">备注</button>
		  <p class="am-text-danger error-msg" style="display: inline-block;"></p>
		</form>
	</div>
	
</div>
<div class="am-g">
	
    <div class="am-u-md-4">
        		<div class="am-panel am-panel-default">
        			<div class="am-panel-hd">订单信息</div>
        			<div class="am-panel-bd">
        				<span>订单编号:{{$order->id}}</span><br>
        				<span>总价:{{$order->product_total_price + $order->freight}}元</span><br>
        				<span>留言:{{$order->leave_message}}</span><br>
        				<span>快递公司:{{$order->express_name}}</span><br>
        				<span>快递单号:{{$order->express_id}}</span><br>
        				<span>时间:{{$order->updated_at}}</span><br>
        				<span>状态:
        						@if($order->status == 0)
				              		未支付
				              	@elseif ($order->status == 1)
								             已支付
								@elseif ($order->status == 2)
								            已发货
								@elseif ($order->status == 3)
								            已退货
								@else
								   系统回收
								@endif
						</span><br>
        			</div>
        		</div>
    </div>
        	<div class="am-u-md-4">
        		<div class="am-panel am-panel-default">
        			<div class="am-panel-hd">地址信息</div>
        			<div class="am-panel-bd">
        				@if(!empty($order->address))
        				<span>收件人:{{$order->address->name}}</span><br>
        				<span>手机:{{$order->address->mobile}}</span><br>
        				<span>邮编:{{$order->address->zipcode}}</span><br>
        				<span>地址:{{$order->address->province}}{{$order->address->city}}{{$order->address->district}}{{$order->address->street}}</span><br>
        				@endif
        			</div>
        		</div>
        	</div>
        	
        	<div class="am-u-md-4">
        		<div class="am-panel am-panel-default">
        			<div class="am-panel-hd">卡片信息</div>
        			<div class="am-panel-bd text-preview">
        				@if(!empty($order->card))
        				{{$order->card->content}}
        				@else
        				我不需要卡片
        				@endif
        			</div>
        		</div>
        	</div>
        	<div class="am-u-md-12 m-cart-table-box">
				<table class="am-table m-cart-table">
				    <thead>
				        <tr>
				            <th>商品</th>
				            <th>价格</th>
				            <th>数量</th>
							<th>金额</th>
				        </tr>
				    </thead>
				    <tbody>
						@foreach($order->products as $orderProduct)
				        <tr>
				            <td>
								<div class='m-cart-item am-cf'>
									<a href="{{URL::to('product', $orderProduct->product->id)}}"><img src='{{Images::url($orderProduct->product->image,72,72)}}'></img><a>
							  		<div class='m-cart-item-bd'>
							  			<div class='name'>{{$orderProduct->product->enname}}</div>
							  			<div class='name'>{{$orderProduct->product->name}}</div>
										@if (!empty($orderProduct->size))
				                        <div class='name'>尺寸:{{$orderProduct->size}}</div>
										@endif
										@if (!empty($orderProduct->color))
				                        <div class='name'>颜色:{{$orderProduct->color}}</div>
										@endif
							  		</div>
								</div>
							</td>
				            <td>￥ {{number_format($orderProduct->price,2)}}</td>
				            <td><span class='quantity'>{{$orderProduct->quantity}}</span></td>
							<td>￥ <span class='money'>{{number_format($orderProduct->quantity * $orderProduct->price,2)}}<span></td>
				        </tr>
						@endforeach
				    </tbody>
				</table>
			</div>
    	</div>
@stop

@section('script')

<script type="text/javascript">
$(function () {
	
});
</script>
@stop
